package routes

import (
	v1 "blockchain_data/api"
	"blockchain_data/config"
	"github.com/gin-gonic/gin"
)

func InitRouter()  {
	gin.SetMode(config.AppModel)
	//gin.DefaultWriter = middleware.GinLogger().Out	//gin使用logrus
	r := gin.Default()

	router := r.Group("api/v1")
	{
		//模块的路由接口
		router.POST("/open_sub",v1.OpenWs)
		router.POST("/close_sub",v1.CloseWs)
		router.GET("/:bourse/:goods/:server",v1.GetServer)
		router.GET("/data",v1.GetData)
	}
	r.Run(config.HttpPort)
}
